package jfrederick8;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

import javax.swing.JPanel;

/**
 * The Panel on which everything will be displayed
 * 
 * @author John Frederick
 * @version 1.0 - 11 February 2012
 */
public class MainPanel extends JPanel{
	/** The distributer allowing access to all game objects */
	private static Distributer dist;
	
	/**
	 * constructs the main panel and establishes the display's preferred size
	 * 
	 * @param dist the distributer allowing access to all of the game's objects
	 */
	public MainPanel(Distributer dist){
		setPreferredSize(new Dimension(500,500));
		MainPanel.dist = dist;
	}//end constructor MainPanel
	
	/**
	 * The method which calls the drawscreen method and displays everything on the panel
	 */
	public void paintComponent(Graphics g){
		dist.getDrawing().drawScreen(g);
	}//end overRide paintComponent
}//end class MainPanel
